{include file="public/header" /}
<section>
	<div class="layui-login">
	<form method="post" action="" class="layui-form layui-form-pane">
    	<div class="layui-form-item">
			<label class="layui-form-label">用户</label>
			<div class="layui-input-block">
				<input type="text" id="username" name="username" lay-verify="required" autocomplete="off" placeholder="请输入用户名" class="layui-input">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">密码</label>
			<div class="layui-input-block">
				<input type="password" id="password" name="password" lay-verify="required" autocomplete="off" placeholder="请输入密码" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<input type="submit" name="dosubmit" id="dosubmit" class="layui-btn" lay-submit="" lay-filter="dosubmit" value="登录">
			</div>
		</div>
	</form>
	</div>
</section>
<script>
layui.use(['form','jquery','layer'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,$ = layui.jquery;
  form.on('submit(dosubmit)', function(data){
  	console.log(data);
  	$.post("{:url('Login/checkLogin')}", {username:data.field.username, password:data.field.password}, function(str){
  		if(str == 1){
  			window.location.href="{:url('Member/index')}";
  		}
  		if(str == 2){
  			layer.msg('账户或密码错误！',{icon: 2, time: 500});
  		}
   		if(str == 3){
  			layer.msg('此账户已锁定！',{icon: 2, time: 500});
  		} 		
  	});
  	return false;
  });
});
</script>
{include file="public/footer" /}
